/********************************************************************************
Name:  PreferredAccountAddress
Copyright © 2012  HFH International
======================================================
======================================================
Purpose:
-------
To make only one active Account Address as preferred. 
======================================================
======================================================
History 
-------
VERSION  AUTHOR                DATE        DETAIL              
  1.0  - CG DEV TEAM    7/10/2012   INITIAL DEVELOPMENT  
*********************************************************************************/ 
trigger PreferredAccountAddress on Account_Address__c(before insert,before update,before delete) {
    

AccountAddressTriggerHandler triggerhandler=new AccountAddressTriggerHandler(); 
    
        if((trigger.isInsert && trigger.isBefore)){
            //handler.OnAccountAddress(trigger.new);
             triggerhandler.AccountAddressInsert(trigger.new);                    
            }
            if(trigger.isUpdate && trigger.isBefore){
            
                triggerhandler.AccountAddressUpdate(trigger.new,trigger.old);
            }
            if(trigger.isdelete && trigger.isBefore){
                triggerhandler.AccountAddressDelete(trigger.old);
            }
   }